<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AllergiesForm.aspx.cs" Inherits="Meditek.UI.AllergiesForm" MasterPageFile="~/MasterPage.Master"%>

<%@ Register Assembly="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet"
    Namespace="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet"
    TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server">
<br />
  <asp:FormView ID="EditFormView" runat="server" DefaultMode= "Insert" DataSourceID="AllergiesDataSource"
	oniteminserting="EditFormView_ItemInserting"  onitemupdating="EditFormView_ItemUpdating" BackColor="#284775" ForeColor="WhiteSmoke" >
	<EditItemTemplate> 
    <table>

	  <tr>
        <td><asp:Label ID="lblidAllergieDisplay" runat="server" Text="id Allergie :" /></td> 
		<td>
		  <asp:TextBox ID="txtidAllergie" runat="server" Text='<%# Bind("idAllergie") %>'
			ReadOnly="true"
			Width = "70px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="idAllergieValidator" runat="server" ControlToValidate="txtidAllergie"
               PropertyName="idAllergie" SourceTypeName="Meditek.Entities.Allergies"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblNameDisplay" runat="server" Text="Name :" /></td> 
		<td>
		  <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="nameValidator" runat="server" ControlToValidate="txtName"
               PropertyName="Name" SourceTypeName="Meditek.Entities.Allergies"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	</table>
	</EditItemTemplate>
	<EmptyDataTemplate>
		<b>Allergies not found..!</b>
	</EmptyDataTemplate>
	<FooterTemplate>
	  <table>
		<tr>
		  <td><asp:Button ID="btnSave" runat="server"   CausesValidation="True"	CommandName="Insert" Text="Save" CssClass="Button" /></td>
 		  <td><asp:Button ID="btnUpdate" runat="server" CausesValidation="True"  CommandName="Update" Text="Save" CssClass="Button" /></td>
		  <td><asp:Button ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="Go To Allergies List" PostBackUrl="AllergiesList.aspx" CssClass="Button" /></td>
        </tr>
	  </table>
	</FooterTemplate>
    </asp:FormView>
	<asp:ObjectDataSource ID="AllergiesDataSource" runat="server" 
         SelectMethod="GetById" TypeName="Meditek.UI.AllergiesReference.AllergiesServiceClient" 
         DataObjectTypeName="Meditek.Entities.Allergies" InsertMethod="Insert"  UpdateMethod="Update"
         oninserted="AllergiesDataSource_CommitChanges" onupdated="AllergiesDataSource_CommitChanges"
         onobjectcreated="AllergiesDataSource_ObjectCreated" >
            <SelectParameters>
                <asp:QueryStringParameter Name="idAllergie" QueryStringField="idAllergie" />
            </SelectParameters>
    </asp:ObjectDataSource>
  </asp:Content>    
